import request from "network/request"

export function Darecommendsong() {
    return request({
        method: 'post',
        url: '/recommend/songs',
        data:{
            "cookie":"__csrf=925b5319039912dbfc4bd979d9b12824; Max-Age=1296010; Expires=Fri, 18 Dec 2020 06:52:59 GMT; Path=/;;MUSIC_U=a70c976cd23ef5e33c358479ebd8590eb0b091fabdc32882a41de1e537bed77f33a649814e309366; Max-Age=1296000; Expires=Fri, 18 Dec 2020 06:52:49 GMT; Path=/;;__remember_me=true; Max-Age=1296000; Expires=Fri, 18 Dec 2020 06:52:49 GMT; Path=/;"
        }
    })
}

export function Darecommendsonglist() {
    return request({
        method: 'post',
        url: '/recommend/resource',
        data:{
            "cookie":"__csrf=925b5319039912dbfc4bd979d9b12824; Max-Age=1296010; Expires=Fri, 18 Dec 2020 06:52:59 GMT; Path=/;;MUSIC_U=a70c976cd23ef5e33c358479ebd8590eb0b091fabdc32882a41de1e537bed77f33a649814e309366; Max-Age=1296000; Expires=Fri, 18 Dec 2020 06:52:49 GMT; Path=/;;__remember_me=true; Max-Age=1296000; Expires=Fri, 18 Dec 2020 06:52:49 GMT; Path=/;"
        }
    })
}

export function Personalized() {
    return request({
        method: 'post',
        url: '/personalized/newsong',
    })
}

export function TopList() {
    return request({
        method: 'post',
        url: '/toplist',
    })
}
export function TopListDetail() {
    return request({
        method: 'post',
        url: '/toplist/detail',
    })
}

/**
 * cat:cat: tag, 比如 " 华语 "、" 古风 " 、" 欧美 "、" 流行 ", 默认为 "全部"
 * limit: 取出歌单数量 , 默认为 50
 * @param {*} cat 
 * @param {*} limit 
 */
export function TopPlayList(cat,limit) {
    return request({
        method: 'post',
        url: '/top/playlist',
        params: {
            cat: cat,
            limit: limit
        }
    })
}
export function PlayListDetail(id) {
    return request({
        method: 'post',
        url: '/playlist/detail',
        params: {
            id:id
        }
    })
}

export function Login() {
    return request({
        method: 'post',
        url: 'http://192.168.3.121/users/registUser',
        data:{
            username:username,
            password:password
        }
    })
}
